package Day08;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        String id="itheima";
        String psw="012";
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i <3 ; i++) {
            System.out.println("请输入账号：");
            String id1=sc.nextLine();
            System.out.println("请输入密码");
            String psw1=sc.nextLine();
            if(id1.equals(id)&&psw1.equals(psw)){
                System.out.println("登录成功");
                break;
            }else{
                if(2-i==0){
                    System.out.println("你的账户暂时被冻结，请稍后再试");
                }else {
                    System.out.println("登录失败，你还有" + (2 - i) + "次机会");
                }
            }
        }
    }
}
